﻿CREATE TABLE [dbo].[ContracteMunca] (
    [IdContract]          INT             IDENTITY (1, 1) NOT NULL,
    [IdPersoana]          INT             CONSTRAINT [DF_CONTRACTE_IdAngajat] DEFAULT ((0)) NOT NULL,
    [Numar]               VARCHAR (10)    NOT NULL,
    [Data]                DATETIME        NOT NULL,
    [PerioadaScadenta]    FLOAT (53)      NULL,
    [TipContract]         INT             NOT NULL,
    [DeLaData]            DATETIME        NOT NULL,
    [PanaLaData]          DATETIME        NULL,
    [PerioadaDeterminata] BIT             CONSTRAINT [DF_CONTRACTE_DETERMINAT] DEFAULT ((0)) NOT NULL,
    [IDOcupatie]          INT             NOT NULL,
    [TipGrad]             INT             NOT NULL,
    [SalarIncadrare]      DECIMAL (18, 2) CONSTRAINT [DF_CONTRACTE_SALAR_INCADRARE] DEFAULT ((0)) NOT NULL,
    [Observatii]          VARCHAR (200)   NULL,
    [CodUnitate]          SMALLINT        CONSTRAINT [DF_CONTRACTE_SALAR_CodUnitate] DEFAULT ((0)) NOT NULL,
    [OreNorma]            SMALLINT        CONSTRAINT [DF_ContracteMunca_OreNorma] DEFAULT ((0)) NOT NULL,
    [FractiuneNorma]      DECIMAL (5, 2)  CONSTRAINT [DF_ContracteMunca_FractiuneNorma] DEFAULT ((1)) NOT NULL,
    CONSTRAINT [PK_CONTRACTS_1__10] PRIMARY KEY CLUSTERED ([IdContract] ASC) WITH (FILLFACTOR = 90),
    CONSTRAINT [FK_ContracteMunca_Ocupatii] FOREIGN KEY ([IDOcupatie]) REFERENCES [dbo].[Ocupatii] ([IDOcupatie]),
    CONSTRAINT [FK_ContracteMunca_TipContracte] FOREIGN KEY ([TipContract]) REFERENCES [dbo].[TipContracte] ([TipContract]),
    CONSTRAINT [FK_ContracteMunca_TipGrad] FOREIGN KEY ([TipGrad]) REFERENCES [dbo].[TipGrad] ([IdTipGrad]),
    CONSTRAINT [FK_ContracteMunca_Unitati] FOREIGN KEY ([CodUnitate]) REFERENCES [dbo].[Unitati] ([CodUnitate])
);

